/*package com.smarttest.portal.service.timertask.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Map;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.chinaway.router.HandlerTest;


public class APIQueryUtil extends HandlerTest {
	
	public static String imei = "107015090000007";
	public static String gpsno = "90000007";
	public static String orgcode = "200ILV01";
	private String alarmnum;
	
	public APIQueryUtil(String rootUrl){
		format = "json";
		apiUrl = rootUrl;
	}
	
	public String getAlarmnum() {
		return alarmnum;
	}


	public void setAlarmnum(String alarmnum) {
		this.alarmnum = alarmnum;
	}


	public static void main(String[] args) {
		APIQueryUtil apiSearchTest = new APIQueryUtil("http://tx.router.huoyunren.com/router/rest");
		System.out.println(apiSearchTest.doAPIUrl("huoyunren.current.fullcurrents",
				"gpsnos", gpsno));
	}
	
	public JSONObject doAPIUrl(String method, Map<String,Object> params){
		String rs = getResult(method,false,params);
		return getResultJson(method, rs);
	}
	public JSONObject doAPIUrl(String method, Object... params){
		String rs = getResult(method,false,params);
		return getResultJson(method, rs);
	}

	private JSONObject getResultJson(String method, String rs) {
		long startTime = System.currentTimeMillis();
		JSONObject resultJson = new JSONObject();
		int code = -999;//默认定义是有问题的，只有返回的json才对
		String message = "";
		try{
			JSONObject resp = JSONObject.parseObject(rs);
			code = resp.getInteger("code");
			message = resp.getString("message");
		}catch(Exception e){
			message = "解析json错误:"+rs;                         
		}
		resultJson.put("code", code);
		resultJson.put("message", message);
		resultJson.put("time", (System.currentTimeMillis()-startTime));
		checkCode(code,method,resultJson);
		return resultJson;
	}

	private void checkCode(int code, String method, JSONObject resultJson) {
		OutboxDaoDxt daoDxt = new OutboxDaoDxt();
		if(code > 0 ){
				daoDxt.insert(10, alarmnum,
						"运营平台-接口监控：method:" + method +"\nmsg："+resultJson, null,
						"dingtalk");
		}
	}
}
*/